<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>去签约</title>
		<link rel="stylesheet" href="__AGENT__/css/iconfont.css" />
		<link rel="stylesheet" href="__AGENT__/css/qianyue.css" />
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
		<style type="text/css">
			#sfz_pic{position: relative;}/*opacity: 0;*/
			 .upload,.upload1{position: absolute;top: 0;left: 0;width: 100%;height: 100%;opacity: 0;}
			#dp_pic{position: relative;}
			 .upload2{position: absolute;top: 0;left: 0;width: 100%;height: 100%;opacity: 0;}
			#yyzz_pic{position: relative;}
			 .upload3{position: absolute;top: 5%;left: 6%;height: 100%;width: 100%;opacity: 0;}
			#qt_pic{position: relative;}
			 .upload4{position: absolute;top: 5%;left: 6%;height: 100%;width: 100%;opacity: 0;}
			
		</style>
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<div class="rigtop">
						<span class="title"><a href="#">签约管理</a><em></em></span>
					</div>
					<div class="indrig_con qianyue_con">
						<div class="qiany_steps"><!--签约步骤--> 
							<div class="qiany_steps_item qiany_steps-status-wait" style="margin-right: -24px; width: 25%;">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">1</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">签约基本信息</div>
										<!-- react-text: 12 -->
										<!-- /react-text -->
									</div>
								</div>
							</div>
							<div class="qiany_steps_item qiany_steps-status-wait" style="margin-right: -24px; width: 25%;">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">2</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">商户注册信息</div>
										<!-- react-text: 22 -->
										<!-- /react-text -->
									</div>
								</div>
							</div>
							<div class="qiany_steps_item qiany_steps-status-wait" style="margin-right: -24px; width: 25%;">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">3</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">结算资金账号</div>
										<!-- react-text: 32 -->
										<!-- /react-text -->
									</div>
								</div>
							</div>
							<div class="qiany_steps_item qiany_steps_choice" style="margin-right: -24px; width: 25%;">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">4</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">上传附件</div>
										<!-- react-text: 42 -->
										<!-- /react-text -->
									</div>
								</div>
							</div>
							<div class="qiany_steps_item qiany_steps-status-wait">
								<div class="qiany_steps_line" style="padding-right: 0px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">5</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">提交签约</div>
										<!-- react-text: 52 -->
										<!-- /react-text -->
									</div>
								</div>
							</div>
						</div>
							<form class="mui-input-group gerenzl_group layui-form">
						<!--签约步骤--> 
						<div class="shxx_item">
								<div class="shxx_title">证件影印件</div>
								<p class="renz_tip">请提交证件原件照片（证件如为复印件，请务必盖公章后再拍照上传），单个文件大小不能超过3M，格式支持.jpg.png</p>
								<ul class="renz_box clearfix">
						    		<li>
						    			<div class="renz_img" id="yyzz_pic" >	
						    				<input type="hidden" name="ids_pic1" value="{$data.ids_pic1}" id="thumb_1" lay-verify="required" autocomplete="off" class="layui-input"/>
						    				<input type="file" id="upload_1" class="upload1" value="选择图片文件" multiple />
						    				{if condition="$data.ids_pic1 == null"}
												<span><img class='img_1' id='img_1' src="__AGENT__/img/renz.jpg"></span>
											{else /}
											<span><img class='img_1' id='img_1' src="{$data.ids_pic1}"></span>
											{/if}
						    				
						    				
						    			</div>
						    			<div>上传身份证正面照片</div>
						    		</li>
						    		<li>
						    			<div class="renz_img " id="yyzz_pic" >
						    				<input type="hidden" name="ids_pic2" value="{$data.ids_pic2}" id="thumb_2" lay-verify="required" autocomplete="off" class="layui-input"/>
						    				<input type="file" id="upload_2" class="upload1" value="选择图片文件" multiple />
						    				{if condition="$data.ids_pic2 == null"}
												<span><img class='img_2' id='img_2' src="__AGENT__/img/renz2.jpg"></span>
											{else /}
												<span><img class='img_2' id='img_2' src="{$data.ids_pic2}"></span>
											{/if}
						    			</div>
						    			<div>上传身份证反面照片</div>
						    		</li>
						    		{if $data['agent_type'] != 2  }
						    		<li>
						    			<div class="renz_img " id="yyzz_pic" >
						    				<input type="hidden" name="license_pic" value="{$data.license_pic}" id="thumb_3" lay-verify="required" autocomplete="off" class="layui-input"/>
						    				<input type="file" id="upload_3" class="upload1" value="选择图片文件" multiple />
						    				{if condition="$data.license_pic == null"}
												<span><img class='img_3' id='img_3' src="__AGENT__/img/renz5.jpg"></span>
											{else /}
												<span><img class='img_3' id='img_3' src="{$data.license_pic}"></span>
											{/if}
						    			</div>
						    			<div>上传营业执照照片</div>
						    		</li>
						    		{/if}
						 			<li>
						    			<div class="renz_img " id="yyzz_pic" >	
						    				<input type="hidden" name="bank_pic" id="thumb_4" value="{$data.bank_pic}" lay-verify="required" autocomplete="off" class="layui-input"/>
						    				<input type="file" id="upload_4" class="upload1" value="选择图片文件" multiple />
						    				{if condition="$data.bank_pic == null"}
												<span><img class='img_4' id='img_4' src="__AGENT__/img/renz4.jpg"></span>
											{else /}
												<span><img class='img_4' id='img_4' src="{$data.bank_pic}"></span>
											{/if}
						    			</div>
						    			<div>上传银行卡正面照片</div>
						    		</li>
						    	</ul>
							</div>
							<div class="shxx_item">
								<div class="shxx_title">经营场所照片</div>
								<ul class="renz_box clearfix">
									<li>
						    			<div class="renz_img " id="yyzz_pic" >	
						    				<input type="hidden" name="door_pic" id="thumb_5" value="{$data.door_pic}" lay-verify="required" autocomplete="off" class="layui-input"/>
						    				<input type="file" id="upload_5" class="upload1" value="选择图片文件" multiple />
						    				{if condition="$data.door_pic == null"}
												<span><img class='img_5' id='img_5' src="__AGENT__/img/renz6.jpg"></span>
											{else /}
												<span><img class='img_5' id='img_5' src="{$data.door_pic}"></span>
											{/if}
						    			</div>
						    			<div>门头照</div>
						    		</li>
						    		<li>
						    			<div class="renz_img " id="yyzz_pic" >	
						    				<input type="hidden" name="indoor_pic" id="thumb_6" value="{$data.indoor_pic}" lay-verify="required" autocomplete="off" class="layui-input"/>
						    				<input type="file" id="upload_6" class="upload1" value="选择图片文件" multiple />
						    				{if condition="$data.indoor_pic == null"}
												<span><img class='img_6' id='img_6' src="__AGENT__/img/renz7.jpg"></span>
											{else /}
												<span><img class='img_6' id='img_6' src="{$data.indoor_pic}"></span>
											{/if}
						    			</div>
						    			<div>内景</div>
						    		</li>
						    	</ul>
							</div>
							<div class="qiany_bzbtnbox">
								<button type="button" class="qiany_bzbtn" lay-submit lay-filter="submit_from"><span>保存并下一步</span></button>
								<button type="button" class="qiany_bzbtn defult fanhui"><span>上一步</span></button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
	</body>

</html>

<script>
//图片上传
	layui.use(['form','upload'], function(){
  		var $ = layui.jquery,upload = layui.upload,form = layui.form;
  		
  		//监听表单提交
		form.on('submit(submit_from)', function(data){
			tijiao();
  			return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
		});
  		
  		
  		var uploadInst_1 = upload.render({
			elem: '#upload_1'
		    ,auto: false //选择文件后不自动上传
		    ,choose: function(obj){
			    //将每次选择的文件追加到文件队列
			    var files = obj.pushFile();
			    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
			    obj.preview(function(index, file, result){
			    	$('#img_1').attr('src', result); //图片链接（base64）
			    	var sendData = result.substring(result.indexOf(";base64,")+8);
			    	$.post("{:url('agent/index/upload')}",{value:sendData},function(data){ 
	                            if(data.code == '200'){  
	                            	$('#thumb_1').val(data.url);
	                            }else{  
	                                layer.msg(data.msg);
	                            }  
                    		});
			    });
			}
		    ,url: "{:url('agent/index/upload')}"
		    ,accept:'images'
		});
		
		var uploadInst_1 = upload.render({
			elem: '#upload_2'
		    ,auto: false //选择文件后不自动上传
		    ,choose: function(obj){
			    //将每次选择的文件追加到文件队列
			    var files = obj.pushFile();
			    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
			    obj.preview(function(index, file, result){
			    	$('#img_2').attr('src', result); //图片链接（base64）
			    	var sendData = result.substring(result.indexOf(";base64,")+8);
			    	$.post("{:url('agent/index/upload')}",{value:sendData},function(data){ 
	                            if(data.code == '200'){  
	                            	$('#thumb_2').val(data.url);
	                            }else{  
	                                layer.msg(data.msg);
	                            }  
                    		});
			    });
			}
		    ,url: "{:url('agent/index/upload')}"
		    ,accept:'images'
		});
		
		var uploadInst_1 = upload.render({
			elem: '#upload_3'
		    ,auto: false //选择文件后不自动上传
		    ,choose: function(obj){
			    //将每次选择的文件追加到文件队列
			    var files = obj.pushFile();
			    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
			    obj.preview(function(index, file, result){
			    	$('#img_3').attr('src', result); //图片链接（base64）
			    	var sendData = result.substring(result.indexOf(";base64,")+8);
			    	$.post("{:url('agent/index/upload')}",{value:sendData},function(data){ 
	                            if(data.code == '200'){  
	                            	$('#thumb_3').val(data.url);
	                            }else{  
	                                layer.msg(data.msg);
	                            }  
                    		});
			    });
			}
		    ,url: "{:url('agent/index/upload')}"
		    ,accept:'images'
		});
		
		var uploadInst_1 = upload.render({
			elem: '#upload_4'
		    ,auto: false //选择文件后不自动上传
		    ,choose: function(obj){
			    //将每次选择的文件追加到文件队列
			    var files = obj.pushFile();
			    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
			    obj.preview(function(index, file, result){
			    	$('#img_4').attr('src', result); //图片链接（base64）
			    	var sendData = result.substring(result.indexOf(";base64,")+8);
			    	$.post("{:url('agent/index/upload')}",{value:sendData},function(data){ 
	                            if(data.code == '200'){  
	                            	$('#thumb_4').val(data.url);
	                            }else{  
	                                layer.msg(data.msg);
	                            }  
                    		});
			    });
			}
		    ,url: "{:url('agent/index/upload')}"
		    ,accept:'images'
		});
		
		var uploadInst_1 = upload.render({
			elem: '#upload_5'
		    ,auto: false //选择文件后不自动上传
		    ,choose: function(obj){
			    //将每次选择的文件追加到文件队列
			    var files = obj.pushFile();
			    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
			    obj.preview(function(index, file, result){
			    	$('#img_5').attr('src', result); //图片链接（base64）
			    	var sendData = result.substring(result.indexOf(";base64,")+8);
			    	$.post("{:url('agent/index/upload')}",{value:sendData},function(data){ 
	                            if(data.code == '200'){  
	                            	$('#thumb_5').val(data.url);
	                            }else{  
	                                layer.msg(data.msg);
	                            }  
                    		});
			    });
			}
		    ,url: "{:url('agent/index/upload')}"
		    ,accept:'images'
		});
		
		var uploadInst_1 = upload.render({
			elem: '#upload_6'
		    ,auto: false //选择文件后不自动上传
		    ,choose: function(obj){
			    //将每次选择的文件追加到文件队列
			    var files = obj.pushFile();
			    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
			    obj.preview(function(index, file, result){
			    	$('#img_6').attr('src', result); //图片链接（base64）
			    	var sendData = result.substring(result.indexOf(";base64,")+8);
			    	$.post("{:url('agent/index/upload')}",{value:sendData},function(data){ 
	                            if(data.code == '200'){  
	                            	$('#thumb_6').val(data.url);
	                            }else{  
	                                layer.msg(data.msg);
	                            }  
                    		});
			    });
			}
		    ,url: "{:url('agent/index/upload')}"
		    ,accept:'images'
		});
	})
//返 回
$('.fanhui').click(function() {
	location.href = "{:url('index/qianyue_step3',['agent_id'=>$agent_id])}";
})
//提交表单
function tijiao(){
	 $.ajax({
         	type:"post",
            url:"{:url('index/qianyue_step4',['agent_id'=>$agent_id])}",
            data: $('.layui-form').serialize(),//表单数据
            success:function(data){
                if(data.code==200){
                	layer.msg('成功', {
					  icon: 1,
					  time: 1500 //2秒关闭（如果不配置，默认是3秒）
					}, function(){
						location.href = "{:url('index/qianyue_step5',['agent_id'=>$agent_id])}";
					});
                }else{
                	layer.msg('失败！');//保存成功提示
                }
            },error:function(data){
            	var a = data;
            }
    });
	
}
</script>